<!--
 * @Description: 面试技巧中的文章预览弹层
 * @Author: 毕富成
 * @Date: 2022-09-17 11:29:06
 * @LastEditTime: 2022-09-21 12:00:01
 * @LastEditors: 毕富成
-->
<template>
  <div class="container">
    <el-dialog
      title="预览文章"
      :visible.sync="dialogVisible"
      width="800px"
      @close="diaClose"
    >
      <div>
        <div class="title">
          <h2>{{ row.title }}</h2>
          <div>
            <span>{{ row.createTime | formatDate }}</span>
            <span>{{ row.username }}</span>
            <span class="el-icon-view"></span>
            <span>{{ row.visits }}</span>
          </div>
        </div>
        <div class="content" v-html="row.articleBody"></div>
      </div>
      <span slot="footer" class="dialog-footer"></span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    row: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      dialogVisible: false
      // row: {}
    }
  },

  methods: {
    // 关闭弹出层
    diaClose() {
      // console.log(1)
    }
  }
}
</script>

<style scoped>
.title {
  border-bottom: 1px dashed #ccc;
  padding-bottom: 10px;
}
.title span {
  margin-left: 10px;
}
.content {
  background: #f5f5f5;
}
</style>
